{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "3xW4O0zuKfWD"
      },
      "outputs": [],
      "source": [
        "import os\n",
        "from openai import OpenAI\n",
        "import rich\n",
        "from google.colab import userdata"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "api_key = userdata.get('OPENAI_API_KEY')\n",
        "MODEL = \"gpt-4o-mini\"\n",
        "\n",
        "openai = OpenAI(api_key=api_key)"
      ],
      "metadata": {
        "id": "vUydnLeLKs03"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "Search the web for the latest information before generating a response\n",
        "\n",
        "1) In Chat API, model always retrieves information from web before responding to your query\n",
        "\n",
        "2) In Responses API, you enable web search by configuring it in the tools, and model can choose to serach the web or not based on the content of the input prompt."
      ],
      "metadata": {
        "id": "blCx6gu1Vl46"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Chat Completion API\n",
        "\n",
        "https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat"
      ],
      "metadata": {
        "id": "5wlqKfVBKyjD"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Always search the web first"
      ],
      "metadata": {
        "id": "79PCOO9i3Yel"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Note: The annotation object will contain links to the web pages from which the model extracted information to construct the output\n",
        "```\n",
        "{\n",
        "    type:'url_citation',\n",
        "    url_citation : {\n",
        "        end_index: 0,\n",
        "        start_index: 0,\n",
        "        title:\"title\",\n",
        "        url:'url'\n",
        "    }\n",
        "}\n",
        "```"
      ],
      "metadata": {
        "id": "GYwnPiN5b8gf"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "In Chat API we have to use specific model that is fine tuned for web searches `gpt-4o-search-preview`"
      ],
      "metadata": {
        "id": "bRPvp6qR3e9z"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "response = openai.chat.completions.create(\n",
        "    model=\"gpt-4o-search-preview\",\n",
        "    web_search_options={},\n",
        "    messages=[\n",
        "        {\n",
        "            \"role\": \"user\",\n",
        "            \"content\": \"What was a positive news story about Agentic AI today?\",\n",
        "        }\n",
        "    ],\n",
        ")\n",
        "\n",
        "print(response.choices[0].message.content)\n",
        "# rich.print(response)\n",
        "print()\n",
        "print(len(response.choices[0].message.annotations))\n",
        "rich.print(response.choices[0].message.annotations)"
      ],
      "metadata": {
        "id": "dBrUkMCUKz0s",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "outputId": "9420e377-726f-44fb-e92e-8ee468c00927"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "As of March 26, 2025, there are no new positive news stories specifically about agentic AI. However, recent developments highlight the growing adoption and impact of agentic AI across various sectors:\n",
            "\n",
            "- **Adobe's AI Innovations**: At the Adobe Summit 2025 held last week in Las Vegas, Adobe introduced the Experience Platform Agent Orchestrator, featuring ten new purpose-built agents designed to streamline processes. These advancements aim to enhance creativity and productivity, particularly in customer experience and marketing. ([techradar.com](https://www.techradar.com/pro/live/adobe-summit-2025-all-the-news-and-updates-as-it-happens?utm_source=openai))\n",
            "\n",
            "- **SAP's Upcoming AI Agents**: In January, SAP CEO Christian Klein announced plans to launch two AI agents later this year, focusing on sales and supply chain applications. These agents are expected to optimize pricing, product bundling, stock availability, and delivery schedules, marking a significant step in AI's evolution within enterprise operations. ([axios.com](https://www.axios.com/2025/01/27/agentic-ai-big-next-step-evolution?utm_source=openai))\n",
            "\n",
            "- **NICE's Financial Success with Agentic AI**: In February, NICE reported exceptional quarterly results, attributing their success to the integration of agentic AI within their CXOne Mpower solution. This AI-driven approach has enabled the company to secure significant deals and set new standards in customer experience solutions. ([cxtoday.com](https://www.cxtoday.com/conversational-ai/agentic-ai-key-to-strong-nice-quarter-hints-at-ai-agent-release/?utm_source=openai))\n",
            "\n",
            "These developments underscore the positive trajectory of agentic AI in enhancing business efficiency and innovation.\n",
            "\n",
            "\n",
            "## Recent Advances in Agentic AI Across Industries:\n",
            "- [Adobe Summit 2025 - everything we heard and learned as it happened](https://www.techradar.com/pro/live/adobe-summit-2025-all-the-news-and-updates-as-it-happens?utm_source=openai)\n",
            "- [Agentic AI is a \"big next step\" in AI's evolution, SAP CEO says](https://www.axios.com/2025/01/27/agentic-ai-big-next-step-evolution?utm_source=openai)\n",
            "- [Autonomous agents and profitability to dominate AI agenda in 2025, executives forecast](https://www.reuters.com/technology/artificial-intelligence/autonomous-agents-profitability-dominate-ai-agenda-2025-executives-forecast-2024-12-12/?utm_source=openai) \n",
            "\n",
            "6\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "\u001b[1m[\u001b[0m\n",
              "    \u001b[1;35mAnnotation\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "        \u001b[33murl_citation\u001b[0m=\u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "            \u001b[33mend_index\u001b[0m=\u001b[1;36m662\u001b[0m,\n",
              "            \u001b[33mstart_index\u001b[0m=\u001b[1;36m534\u001b[0m,\n",
              "            \u001b[33mtitle\u001b[0m=\u001b[32m'Adobe Summit 2025 - everything we heard and learned as it happened'\u001b[0m,\n",
              "            \u001b[33murl\u001b[0m=\u001b[32m'https://www.techradar.com/pro/live/adobe-summit-2025-all-the-news-and-updates-as-it-happens?\u001b[0m\u001b[32mutm_so\u001b[0m\n",
              "\u001b[32murce\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "        \u001b[1m)\u001b[0m\n",
              "    \u001b[1m)\u001b[0m,\n",
              "    \u001b[1;35mAnnotation\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "        \u001b[33murl_citation\u001b[0m=\u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "            \u001b[33mend_index\u001b[0m=\u001b[1;36m1122\u001b[0m,\n",
              "            \u001b[33mstart_index\u001b[0m=\u001b[1;36m1022\u001b[0m,\n",
              "            \u001b[33mtitle\u001b[0m=\u001b[32m'Agentic AI is a \"big next step\" in AI\\'s evolution, SAP CEO says'\u001b[0m,\n",
              "            \u001b[33murl\u001b[0m=\u001b[32m'https://www.axios.com/2025/01/27/agentic-ai-big-next-step-evolution?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "        \u001b[1m)\u001b[0m\n",
              "    \u001b[1m)\u001b[0m,\n",
              "    \u001b[1;35mAnnotation\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "        \u001b[33murl_citation\u001b[0m=\u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "            \u001b[33mend_index\u001b[0m=\u001b[1;36m1598\u001b[0m,\n",
              "            \u001b[33mstart_index\u001b[0m=\u001b[1;36m1457\u001b[0m,\n",
              "            \u001b[33mtitle\u001b[0m=\u001b[32m'Agentic AI Key to Strong NICE Quarter - CX Today'\u001b[0m,\n",
              "            \u001b[33murl\u001b[0m=\u001b[32m'https://www.cxtoday.com/conversational-ai/agentic-ai-key-to-strong-nice-quarter-hints-at-ai-agent-\u001b[0m\n",
              "\u001b[32mrelease/?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "        \u001b[1m)\u001b[0m\n",
              "    \u001b[1m)\u001b[0m,\n",
              "    \u001b[1;35mAnnotation\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "        \u001b[33murl_citation\u001b[0m=\u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "            \u001b[33mend_index\u001b[0m=\u001b[1;36m1952\u001b[0m,\n",
              "            \u001b[33mstart_index\u001b[0m=\u001b[1;36m1773\u001b[0m,\n",
              "            \u001b[33mtitle\u001b[0m=\u001b[32m'Adobe Summit 2025 - everything we heard and learned as it happened'\u001b[0m,\n",
              "            \u001b[33murl\u001b[0m=\u001b[32m'https://www.techradar.com/pro/live/adobe-summit-2025-all-the-news-and-updates-as-it-happens?\u001b[0m\u001b[32mutm_so\u001b[0m\n",
              "\u001b[32murce\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "        \u001b[1m)\u001b[0m\n",
              "    \u001b[1m)\u001b[0m,\n",
              "    \u001b[1;35mAnnotation\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "        \u001b[33murl_citation\u001b[0m=\u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "            \u001b[33mend_index\u001b[0m=\u001b[1;36m2107\u001b[0m,\n",
              "            \u001b[33mstart_index\u001b[0m=\u001b[1;36m1955\u001b[0m,\n",
              "            \u001b[33mtitle\u001b[0m=\u001b[32m'Agentic AI is a \"big next step\" in AI\\'s evolution, SAP CEO says'\u001b[0m,\n",
              "            \u001b[33murl\u001b[0m=\u001b[32m'https://www.axios.com/2025/01/27/agentic-ai-big-next-step-evolution?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "        \u001b[1m)\u001b[0m\n",
              "    \u001b[1m)\u001b[0m,\n",
              "    \u001b[1;35mAnnotation\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "        \u001b[33murl_citation\u001b[0m=\u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "            \u001b[33mend_index\u001b[0m=\u001b[1;36m2364\u001b[0m,\n",
              "            \u001b[33mstart_index\u001b[0m=\u001b[1;36m2110\u001b[0m,\n",
              "            \u001b[33mtitle\u001b[0m=\u001b[32m'Autonomous agents and profitability to dominate AI agenda in 2025, executives forecast'\u001b[0m,\n",
              "            \u001b[33murl\u001b[0m=\u001b[32m'https://www.reuters.com/technology/artificial-intelligence/autonomous-agents-profitability-dominat\u001b[0m\n",
              "\u001b[32me-ai-agenda-2025-executives-forecast-2024-12-12/?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "        \u001b[1m)\u001b[0m\n",
              "    \u001b[1m)\u001b[0m\n",
              "\u001b[1m]\u001b[0m\n"
            ],
            "text/html": [
              "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">[</span>\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Annotation</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">url_citation</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">662</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">534</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Adobe Summit 2025 - everything we heard and learned as it happened'</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.techradar.com/pro/live/adobe-summit-2025-all-the-news-and-updates-as-it-happens?utm_so</span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">urce=openai'</span>\n",
              "        <span style=\"font-weight: bold\">)</span>\n",
              "    <span style=\"font-weight: bold\">)</span>,\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Annotation</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">url_citation</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1122</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1022</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Agentic AI is a \"big next step\" in AI\\'s evolution, SAP CEO says'</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.axios.com/2025/01/27/agentic-ai-big-next-step-evolution?utm_source=openai'</span>\n",
              "        <span style=\"font-weight: bold\">)</span>\n",
              "    <span style=\"font-weight: bold\">)</span>,\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Annotation</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">url_citation</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1598</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1457</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Agentic AI Key to Strong NICE Quarter - CX Today'</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.cxtoday.com/conversational-ai/agentic-ai-key-to-strong-nice-quarter-hints-at-ai-agent-</span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">release/?utm_source=openai'</span>\n",
              "        <span style=\"font-weight: bold\">)</span>\n",
              "    <span style=\"font-weight: bold\">)</span>,\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Annotation</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">url_citation</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1952</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1773</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Adobe Summit 2025 - everything we heard and learned as it happened'</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.techradar.com/pro/live/adobe-summit-2025-all-the-news-and-updates-as-it-happens?utm_so</span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">urce=openai'</span>\n",
              "        <span style=\"font-weight: bold\">)</span>\n",
              "    <span style=\"font-weight: bold\">)</span>,\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Annotation</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">url_citation</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2107</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1955</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Agentic AI is a \"big next step\" in AI\\'s evolution, SAP CEO says'</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.axios.com/2025/01/27/agentic-ai-big-next-step-evolution?utm_source=openai'</span>\n",
              "        <span style=\"font-weight: bold\">)</span>\n",
              "    <span style=\"font-weight: bold\">)</span>,\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Annotation</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">url_citation</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2364</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2110</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Autonomous agents and profitability to dominate AI agenda in 2025, executives forecast'</span>,\n",
              "            <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.reuters.com/technology/artificial-intelligence/autonomous-agents-profitability-dominat</span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">e-ai-agenda-2025-executives-forecast-2024-12-12/?utm_source=openai'</span>\n",
              "        <span style=\"font-weight: bold\">)</span>\n",
              "    <span style=\"font-weight: bold\">)</span>\n",
              "<span style=\"font-weight: bold\">]</span>\n",
              "</pre>\n"
            ]
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Responses API\n",
        "\n",
        "https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses"
      ],
      "metadata": {
        "id": "tCzSosP5K-JR"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Model will choose to search the web or not based on the content of the input prompt."
      ],
      "metadata": {
        "id": "zEHOqHav3tTm"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "Note: The annotation object will contain links to the web pages from which the model extracted information to construct the output.\n",
        "\n",
        "In the Responses API, you can see that the annotation object does not contain a nested `url_citation` object, unlike in the Chat API.\n",
        "```\n",
        "{\n",
        "    type:'url_citation',\n",
        "    end_index: 0,\n",
        "    start_index: 0,\n",
        "    title:\"title\",\n",
        "    url:'url'\n",
        "}\n",
        "```"
      ],
      "metadata": {
        "id": "9RzqTpyW3vL1"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "response = openai.responses.create(\n",
        "    model=MODEL,  # using standard model\n",
        "    tools=[{\"type\": \"web_search_preview\"}],\n",
        "    input=\"What was a positive news story from today?\"\n",
        ")\n",
        "\n",
        "print(response.output_text)\n",
        "rich.print(response.output)\n",
        "# rich.print(response.output[1].content[0].annotations)\n",
        "rich.print(response.tools)\n",
        "# rich.print(response)"
      ],
      "metadata": {
        "id": "gUjC_PQCcETm",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "outputId": "f7493233-6977-4dd6-f544-38a0e85d4f9c"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "As of March 26, 2025, here are some positive news stories from around the world:\n",
            "\n",
            "**1. Utrecht's 'Fish Doorbell' Promotes Ecological Awareness**\n",
            "\n",
            "In the central Dutch city of Utrecht, a 'fish doorbell' has been installed on a river lock, allowing viewers of an online livestream to alert authorities when fish are hindered during their spring migration to shallow spawning grounds. This initiative, now in its fifth year, has attracted millions of viewers globally, combining slow TV with ecological activism. ([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\n",
            "\n",
            "**2. Electric Tricycles Empower Rural Women in Zimbabwe**\n",
            "\n",
            "In rural Zimbabwe, electric tricycles are providing women with new economic opportunities and a sense of empowerment. Anna Bhobho, a 31-year-old housewife, now drives an electric tricycle, challenging traditional gender roles and offering financial independence in her village. This trend is reversing the exclusion of women from mainstream economic activities in many parts of rural sub-Saharan Africa. ([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\n",
            "\n",
            "**3. Reduction of Pesticide Use in the UK to Protect Bees**\n",
            "\n",
            "The UK government has announced plans to reduce pesticide use on farms by 10% by 2030 to protect bees and other pollinators. This initiative aligns with the European Union's more ambitious target of reducing the use and risk of chemical pesticides by 50% by 2030. Campaigners have welcomed the news, highlighting the importance of safeguarding pollinators for biodiversity and agriculture. ([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\n",
            "\n",
            "**4. Annual Reunion Between Turkish Fisherman and Migratory Stork**\n",
            "\n",
            "In the rural Eskikaraagac Village near Uluabat Lake in Turkey, a touching annual reunion took place for the 14th year. Yaren, a white stork, landed on the fishing boat of Adem Yilmaz, symbolizing a unique bond between the two. This event continues to captivate locals and nature enthusiasts, showcasing the deep connections between humans and wildlife. ([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\n",
            "\n",
            "These stories highlight positive developments in environmental conservation, women's empowerment, and cultural connections, reflecting the ongoing efforts to create a better world. \n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "\u001b[1m[\u001b[0m\n",
              "    \u001b[1;35mResponseFunctionWebSearch\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mid\u001b[0m=\u001b[32m'ws_67e38d18bcfc8192aaca87b9a7bc9967000f243291749fc1'\u001b[0m,\n",
              "        \u001b[33mstatus\u001b[0m=\u001b[32m'completed'\u001b[0m,\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'web_search_call'\u001b[0m\n",
              "    \u001b[1m)\u001b[0m,\n",
              "    \u001b[1;35mResponseOutputMessage\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mid\u001b[0m=\u001b[32m'msg_67e38d1b26b881929ead18785688f045000f243291749fc1'\u001b[0m,\n",
              "        \u001b[33mcontent\u001b[0m=\u001b[1m[\u001b[0m\n",
              "            \u001b[1;35mResponseOutputText\u001b[0m\u001b[1m(\u001b[0m\n",
              "                \u001b[33mannotations\u001b[0m=\u001b[1m[\u001b[0m\n",
              "                    \u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "                        \u001b[33mend_index\u001b[0m=\u001b[1;36m593\u001b[0m,\n",
              "                        \u001b[33mstart_index\u001b[0m=\u001b[1;36m510\u001b[0m,\n",
              "                        \u001b[33mtitle\u001b[0m=\u001b[32m'Global Good News - Good news from around the world - 25 March 2025'\u001b[0m,\n",
              "                        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "                        \u001b[33murl\u001b[0m=\u001b[32m'https://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "                    \u001b[1m)\u001b[0m,\n",
              "                    \u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "                        \u001b[33mend_index\u001b[0m=\u001b[1;36m1141\u001b[0m,\n",
              "                        \u001b[33mstart_index\u001b[0m=\u001b[1;36m1058\u001b[0m,\n",
              "                        \u001b[33mtitle\u001b[0m=\u001b[32m'Global Good News - Good news from around the world - 25 March 2025'\u001b[0m,\n",
              "                        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "                        \u001b[33murl\u001b[0m=\u001b[32m'https://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "                    \u001b[1m)\u001b[0m,\n",
              "                    \u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "                        \u001b[33mend_index\u001b[0m=\u001b[1;36m1677\u001b[0m,\n",
              "                        \u001b[33mstart_index\u001b[0m=\u001b[1;36m1594\u001b[0m,\n",
              "                        \u001b[33mtitle\u001b[0m=\u001b[32m'Global Good News - Good news from around the world - 25 March 2025'\u001b[0m,\n",
              "                        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "                        \u001b[33murl\u001b[0m=\u001b[32m'https://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "                    \u001b[1m)\u001b[0m,\n",
              "                    \u001b[1;35mAnnotationURLCitation\u001b[0m\u001b[1m(\u001b[0m\n",
              "                        \u001b[33mend_index\u001b[0m=\u001b[1;36m2184\u001b[0m,\n",
              "                        \u001b[33mstart_index\u001b[0m=\u001b[1;36m2101\u001b[0m,\n",
              "                        \u001b[33mtitle\u001b[0m=\u001b[32m'Global Good News - Good news from around the world - 25 March 2025'\u001b[0m,\n",
              "                        \u001b[33mtype\u001b[0m=\u001b[32m'url_citation'\u001b[0m,\n",
              "                        \u001b[33murl\u001b[0m=\u001b[32m'https://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m'\u001b[0m\n",
              "                    \u001b[1m)\u001b[0m\n",
              "                \u001b[1m]\u001b[0m,\n",
              "                \u001b[33mtext\u001b[0m=\u001b[32m\"As\u001b[0m\u001b[32m of March 26, 2025, here are some positive news stories from around the world:\\n\\n**1. \u001b[0m\n",
              "\u001b[32mUtrecht's 'Fish Doorbell' Promotes Ecological Awareness**\\n\\nIn the central Dutch city of Utrecht, a 'fish \u001b[0m\n",
              "\u001b[32mdoorbell' has been installed on a river lock, allowing viewers of an online livestream to alert authorities when \u001b[0m\n",
              "\u001b[32mfish are hindered during their spring migration to shallow spawning grounds. This initiative, now in its fifth \u001b[0m\n",
              "\u001b[32myear, has attracted millions of viewers globally, combining slow TV with ecological activism. \u001b[0m\n",
              "\u001b[32m(\u001b[0m\u001b[32m[\u001b[0m\u001b[32mglobalgoodnews.com\u001b[0m\u001b[32m]\u001b[0m\u001b[32m(\u001b[0m\u001b[32mhttps://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m)\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\n\\n**2. Electric Tricycles \u001b[0m\n",
              "\u001b[32mEmpower Rural Women in Zimbabwe**\\n\\nIn rural Zimbabwe, electric tricycles are providing women with new economic \u001b[0m\n",
              "\u001b[32mopportunities and a sense of empowerment. Anna Bhobho, a 31-year-old housewife, now drives an electric tricycle, \u001b[0m\n",
              "\u001b[32mchallenging traditional gender roles and offering financial independence in her village. This trend is reversing \u001b[0m\n",
              "\u001b[32mthe exclusion of women from mainstream economic activities in many parts of rural sub-Saharan Africa. \u001b[0m\n",
              "\u001b[32m(\u001b[0m\u001b[32m[\u001b[0m\u001b[32mglobalgoodnews.com\u001b[0m\u001b[32m]\u001b[0m\u001b[32m(\u001b[0m\u001b[32mhttps://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m)\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\n\\n**3. Reduction of Pesticide \u001b[0m\n",
              "\u001b[32mUse in the UK to Protect Bees**\\n\\nThe UK government has announced plans to reduce pesticide use on farms by 10% by\u001b[0m\n",
              "\u001b[32m2030 to protect bees and other pollinators. This initiative aligns with the European Union's more ambitious target \u001b[0m\n",
              "\u001b[32mof reducing the use and risk of chemical pesticides by 50% by 2030. Campaigners have welcomed the news, \u001b[0m\n",
              "\u001b[32mhighlighting the importance of safeguarding pollinators for biodiversity and agriculture. \u001b[0m\n",
              "\u001b[32m(\u001b[0m\u001b[32m[\u001b[0m\u001b[32mglobalgoodnews.com\u001b[0m\u001b[32m]\u001b[0m\u001b[32m(\u001b[0m\u001b[32mhttps://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m)\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\n\\n**4. Annual Reunion Between \u001b[0m\n",
              "\u001b[32mTurkish Fisherman and Migratory Stork**\\n\\nIn the rural Eskikaraagac Village near Uluabat Lake in Turkey, a \u001b[0m\n",
              "\u001b[32mtouching annual reunion took place for the 14th year. Yaren, a white stork, landed on the fishing boat of Adem \u001b[0m\n",
              "\u001b[32mYilmaz, symbolizing a unique bond between the two. This event continues to captivate locals and nature enthusiasts,\u001b[0m\n",
              "\u001b[32mshowcasing the deep connections between humans and wildlife. \u001b[0m\n",
              "\u001b[32m(\u001b[0m\u001b[32m[\u001b[0m\u001b[32mglobalgoodnews.com\u001b[0m\u001b[32m]\u001b[0m\u001b[32m(\u001b[0m\u001b[32mhttps://www.globalgoodnews.com/index.html?\u001b[0m\u001b[32mutm_source\u001b[0m\u001b[32m=\u001b[0m\u001b[32mopenai\u001b[0m\u001b[32m)\u001b[0m\u001b[32m)\u001b[0m\u001b[32m\\n\\nThese stories highlight \u001b[0m\n",
              "\u001b[32mpositive developments in environmental conservation, women's empowerment, and cultural connections, reflecting the \u001b[0m\n",
              "\u001b[32mongoing efforts to create a better world. \"\u001b[0m,\n",
              "                \u001b[33mtype\u001b[0m=\u001b[32m'output_text'\u001b[0m\n",
              "            \u001b[1m)\u001b[0m\n",
              "        \u001b[1m]\u001b[0m,\n",
              "        \u001b[33mrole\u001b[0m=\u001b[32m'assistant'\u001b[0m,\n",
              "        \u001b[33mstatus\u001b[0m=\u001b[32m'completed'\u001b[0m,\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'message'\u001b[0m\n",
              "    \u001b[1m)\u001b[0m\n",
              "\u001b[1m]\u001b[0m\n"
            ],
            "text/html": [
              "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">[</span>\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">ResponseFunctionWebSearch</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'ws_67e38d18bcfc8192aaca87b9a7bc9967000f243291749fc1'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">status</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'completed'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'web_search_call'</span>\n",
              "    <span style=\"font-weight: bold\">)</span>,\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">ResponseOutputMessage</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'msg_67e38d1b26b881929ead18785688f045000f243291749fc1'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">content</span>=<span style=\"font-weight: bold\">[</span>\n",
              "            <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">ResponseOutputText</span><span style=\"font-weight: bold\">(</span>\n",
              "                <span style=\"color: #808000; text-decoration-color: #808000\">annotations</span>=<span style=\"font-weight: bold\">[</span>\n",
              "                    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">593</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">510</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Global Good News - Good news from around the world - 25 March 2025'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.globalgoodnews.com/index.html?utm_source=openai'</span>\n",
              "                    <span style=\"font-weight: bold\">)</span>,\n",
              "                    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1141</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1058</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Global Good News - Good news from around the world - 25 March 2025'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.globalgoodnews.com/index.html?utm_source=openai'</span>\n",
              "                    <span style=\"font-weight: bold\">)</span>,\n",
              "                    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1677</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1594</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Global Good News - Good news from around the world - 25 March 2025'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.globalgoodnews.com/index.html?utm_source=openai'</span>\n",
              "                    <span style=\"font-weight: bold\">)</span>,\n",
              "                    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">AnnotationURLCitation</span><span style=\"font-weight: bold\">(</span>\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">end_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2184</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">start_index</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2101</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Global Good News - Good news from around the world - 25 March 2025'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'url_citation'</span>,\n",
              "                        <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'https://www.globalgoodnews.com/index.html?utm_source=openai'</span>\n",
              "                    <span style=\"font-weight: bold\">)</span>\n",
              "                <span style=\"font-weight: bold\">]</span>,\n",
              "                <span style=\"color: #808000; text-decoration-color: #808000\">text</span>=<span style=\"color: #008000; text-decoration-color: #008000\">\"As of March 26, 2025, here are some positive news stories from around the world:\\n\\n**1. </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">Utrecht's 'Fish Doorbell' Promotes Ecological Awareness**\\n\\nIn the central Dutch city of Utrecht, a 'fish </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">doorbell' has been installed on a river lock, allowing viewers of an online livestream to alert authorities when </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">fish are hindered during their spring migration to shallow spawning grounds. This initiative, now in its fifth </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">year, has attracted millions of viewers globally, combining slow TV with ecological activism. </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\\n\\n**2. Electric Tricycles </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">Empower Rural Women in Zimbabwe**\\n\\nIn rural Zimbabwe, electric tricycles are providing women with new economic </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">opportunities and a sense of empowerment. Anna Bhobho, a 31-year-old housewife, now drives an electric tricycle, </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">challenging traditional gender roles and offering financial independence in her village. This trend is reversing </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">the exclusion of women from mainstream economic activities in many parts of rural sub-Saharan Africa. </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\\n\\n**3. Reduction of Pesticide </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">Use in the UK to Protect Bees**\\n\\nThe UK government has announced plans to reduce pesticide use on farms by 10% by</span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">2030 to protect bees and other pollinators. This initiative aligns with the European Union's more ambitious target </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">of reducing the use and risk of chemical pesticides by 50% by 2030. Campaigners have welcomed the news, </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">highlighting the importance of safeguarding pollinators for biodiversity and agriculture. </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\\n\\n**4. Annual Reunion Between </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">Turkish Fisherman and Migratory Stork**\\n\\nIn the rural Eskikaraagac Village near Uluabat Lake in Turkey, a </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">touching annual reunion took place for the 14th year. Yaren, a white stork, landed on the fishing boat of Adem </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">Yilmaz, symbolizing a unique bond between the two. This event continues to captivate locals and nature enthusiasts,</span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">showcasing the deep connections between humans and wildlife. </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">([globalgoodnews.com](https://www.globalgoodnews.com/index.html?utm_source=openai))\\n\\nThese stories highlight </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">positive developments in environmental conservation, women's empowerment, and cultural connections, reflecting the </span>\n",
              "<span style=\"color: #008000; text-decoration-color: #008000\">ongoing efforts to create a better world. \"</span>,\n",
              "                <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'output_text'</span>\n",
              "            <span style=\"font-weight: bold\">)</span>\n",
              "        <span style=\"font-weight: bold\">]</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">role</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'assistant'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">status</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'completed'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'message'</span>\n",
              "    <span style=\"font-weight: bold\">)</span>\n",
              "<span style=\"font-weight: bold\">]</span>\n",
              "</pre>\n"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "\u001b[1m[\u001b[0m\n",
              "    \u001b[1;35mWebSearchTool\u001b[0m\u001b[1m(\u001b[0m\n",
              "        \u001b[33mtype\u001b[0m=\u001b[32m'web_search_preview'\u001b[0m,\n",
              "        \u001b[33msearch_context_size\u001b[0m=\u001b[32m'medium'\u001b[0m,\n",
              "        \u001b[33muser_location\u001b[0m=\u001b[1;35mUserLocation\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[32m'approximate'\u001b[0m, \u001b[33mcity\u001b[0m=\u001b[3;35mNone\u001b[0m, \u001b[33mcountry\u001b[0m=\u001b[32m'US'\u001b[0m, \u001b[33mregion\u001b[0m=\u001b[3;35mNone\u001b[0m, \u001b[33mtimezone\u001b[0m=\u001b[3;35mNone\u001b[0m\u001b[1m)\u001b[0m\n",
              "    \u001b[1m)\u001b[0m\n",
              "\u001b[1m]\u001b[0m\n"
            ],
            "text/html": [
              "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">[</span>\n",
              "    <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">WebSearchTool</span><span style=\"font-weight: bold\">(</span>\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'web_search_preview'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">search_context_size</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'medium'</span>,\n",
              "        <span style=\"color: #808000; text-decoration-color: #808000\">user_location</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">UserLocation</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'approximate'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">city</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>, <span style=\"color: #808000; text-decoration-color: #808000\">country</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'US'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">region</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>, <span style=\"color: #808000; text-decoration-color: #808000\">timezone</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span><span style=\"font-weight: bold\">)</span>\n",
              "    <span style=\"font-weight: bold\">)</span>\n",
              "<span style=\"font-weight: bold\">]</span>\n",
              "</pre>\n"
            ]
          },
          "metadata": {}
        }
      ]
    }
  ]
}